home *** CD-ROM | disk | FTP | other *** search
- #include "mp.h"
- #include <prefs/palette.h>
- #include <prefs/prefhdr.h>
-
- extern struct MPSem *MPSem;
-
- BOOL LoadPalettePrefs(void)
- {
- struct IFFHandle *iff;
- struct StoredProperty *sp;
- LONG error=0;
-
- MPSem->PPrefsSet=FALSE;
-
- if(iff=AllocIFF())
- {
- if(iff->iff_Stream = Open ("env:sys/palette.prefs",MODE_OLDFILE))
- {
- InitIFFasDOS(iff);
- if(!(error=OpenIFF(iff,IFFF_READ)) )
- {
- if (!(error=PropChunk(iff,ID_PREF,ID_PALT)))
- {
- if(!(error=StopOnExit(iff,ID_PREF,ID_FORM)))
- {
- if((error=ParseIFF(iff,IFFPARSE_SCAN))>-3)
- {
- if(sp=FindProp(iff,ID_PREF,ID_PALT))
- {
- MPSem->PPrefs=*(struct PalettePrefs *)sp->sp_Data;
- MPSem->PPrefsSet=TRUE;
- }
- }/* end ParseIFF if */
- }
- } /* End Prop MPPR */
- CloseIFF(iff);
- }
- Close(iff->iff_Stream);
- }
- FreeIFF(iff);
- }
-
- if(error<0)
- return(FALSE);
-
- return(TRUE);
- }
-